from sqlalchemy import orm


class History(object):

    def __init__(self, datetime, action):
        self.datetime = datetime
        self.action = action

    def __repr__(self):
        return "<%s action='%s' datetime='%s'>" % (
            self.__class__.__name__, self.action, self.datetime)

def make_maps(metadata):
    # XXX I think this needs to be redone... the table instance may need to be
    # present in the same context where queries are being run... or better yet,
    # see the SQLAlchemy docs "Creating Table, Class and Mapper All at Once
    # Declaratively"
    orm.mapper(History, schema.get_history_table(metadata))
